<!--
 * @Author: your name
 * @Date: 2021-08-14 10:24:05
 * @LastEditTime: 2021-08-14 15:54:59
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /常用js/拉钩教育/作业记录/work3/fed-e-task-03-01/test.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<!-- <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script> -->

<body>
    <div id="app">
        <div @click="run()">app</div>
        <p>{{dog.name}}</p>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                o: 'object',
                dog: {}
            },
            methods: {
                fn() {
                    console.log(1);
                    // 该 name 属性是否是响应式的
                    // this.dog.name = 'Trump'
                    // console.log(this.dog)
                },
                run: function () {
                    console.log(1)
                    // this.dog.name = 'Trump';
                    // Vue.set(vm.dog, 'name', 2)
                    this.$set(this.dog, 'name', 2)
                    console.log(this.dog)
                    // this.dog.name = '333'
                    // console.log(this.dog)
                }
            }
        })
    </script>
</body>
</html>